package com.smart.es.entity;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.math.BigDecimal;
import java.util.Date;

/**
 * mysql数据 业务相关
 * PO对象 至存储查询字段
 * spring-data-elasticsearch 4
 */

/**
 * 搜索服务
 */
@Data
@Document(indexName = "index_product")
public class Product {
    @Field(value = "product_id")
    private Long productId;
    @Field(value = "title", analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String title;
    @Field
    private BigDecimal price;
    @Field(value = "title", analyzer = "ik_smart", searchAnalyzer = "ik_smart")
    private String name;
    @Field(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
}
